-#
-# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
-# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
-# Created By:
-# Maintained By:
-#
-extends 'layouts/_widget_box.haml'

-block widget_help
  risk

-block widget_id
  risk_widget

-block widget_class
  risk

-block widget_title
  Risk

-block widget_buttons
  .filter
    .row-fluid
      .span8
        %input.ui-corner-all.widgetsearch.clear-value{type :'text', placeholder :'Search'}
      .span4
        %a.btn.btn-add.pull-right{ 'href': 'javascript://', 'data-toggle': 'modal-ajax-form', 'data-modal-reset': 'reset', 'data-form-target': 'refresh', 'data-modal-class': 'modal-wide', 'data-object-singular': 'Risk', 'data-object-plural': 'risks' } 
          %i.grcicon-add
          %span.object-type Risk

-set quick_result_risk = quick_result_risk if quick_result_risk else None
-set prefix = "qf" if quick_result_risk else "dash"

-from "shared/_quick_find.haml" import tab

-block main
  .tabbable.tabs-left{ id : "={None if quick_result_risk is defined else \"quick_find_risk\"}" }
    %ul.nav.nav-tabs
      =tab("Risk", "Risks", "/search?s=&qr={0}".format(quick_result_business_objects), "active", "risk")
      =tab("Risky Attribute", "Risky Attributes", "/search?s=&qr={0}".format(quick_result_business_objects), "", "risk")

    .tab-content
      .tab-pane{ id : "#{prefix}_risks" }
      .tab-pane{ id : "#{prefix}_risky_attributes" }
